// /*
// *Vue-CLI项目的核心配置文件
// */
// const webpack = require("webpack");
const path = require('path')
// const { config } = require('process');
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  //  configureWebpack: {
  //    plugins: [
  //      new webpack.ProvidePlugin({
  //        $: "jquery",
  //        jQuery: "jquery",
  //        "window.jQuery": "jquery",
  //        Popper: ["popper.js", "default"],
  //      }),
  //    ]
  //  }
  publicPath:
    process.env.NODE_ENV === 'production'
      ? './'
      : '/',
  outputDir: "count",
  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('components', resolve('src/components'))
      .set('layout', resolve('src/layout'))
      .set('base', resolve('src/base'))
      .set('@static', resolve('static'))
  },
  devServer: {
    port: 8080,
    proxy: {
      '/osmp_sm': {
        target: process.env.VUE_APP_OSMP_SM_API_URL,
        changeOrigin: true, // 是否改变域名
        ws: true,
        pathRewrite: {
          '^/osmp_sm': '',
        },
      },
    },
  },
}
